package com.fanxuankai.boot.upush.model;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.Map;

/**
 * @author fanxuankai
 */
public class AndroidUnicast implements Msg {
    @JSONField(name = "appkey")
    private String appKey;
    private String timestamp;
    private String type = "unicast";
    @JSONField(name = "production_mode")
    private String productionMode;
    @JSONField(name = "device_tokens")
    private String deviceTokens;
    private Payload payload;
    private Policy policy;
    private String description;

    public String getAppKey() {
        return appKey;
    }

    @Override
    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }

    public String getTimestamp() {
        return timestamp;
    }

    @Override
    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getProductionMode() {
        return productionMode;
    }

    public void setProductionMode(String productionMode) {
        this.productionMode = productionMode;
    }

    public String getDeviceTokens() {
        return deviceTokens;
    }

    public void setDeviceTokens(String deviceTokens) {
        this.deviceTokens = deviceTokens;
    }

    public Payload getPayload() {
        return payload;
    }

    public void setPayload(Payload payload) {
        this.payload = payload;
    }

    public Policy getPolicy() {
        return policy;
    }

    public void setPolicy(Policy policy) {
        this.policy = policy;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static class Payload {
        @JSONField(name = "display_type")
        private String displayType;
        private Body body;
        private Map<String, String> extra;

        public String getDisplayType() {
            return displayType;
        }

        public void setDisplayType(String displayType) {
            this.displayType = displayType;
        }

        public Body getBody() {
            return body;
        }

        public void setBody(Body body) {
            this.body = body;
        }

        public Map<String, String> getExtra() {
            return extra;
        }

        public void setExtra(Map<String, String> extra) {
            this.extra = extra;
        }

        public static class Body {
            private String ticker;
            private String title;
            private String text;
            @JSONField(name = "after_open")
            private String afterOpen;

            public String getTicker() {
                return ticker;
            }

            public void setTicker(String ticker) {
                this.ticker = ticker;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getText() {
                return text;
            }

            public void setText(String text) {
                this.text = text;
            }

            public String getAfterOpen() {
                return afterOpen;
            }

            public void setAfterOpen(String afterOpen) {
                this.afterOpen = afterOpen;
            }
        }
    }

    public static class Policy {
        @JSONField(name = "expire_time")
        private String expireTime;

        public String getExpireTime() {
            return expireTime;
        }

        public void setExpireTime(String expireTime) {
            this.expireTime = expireTime;
        }
    }
}
